<template>
  <add @submit="handleSubmit"></add>
</template>

<script>
import add from "@/components/addUpdatePetowners";
export default {
  components: {
    add
  },
  methods: {
    async handleSubmit(p) {
      this.$store.dispatch("Petowners/addPetowners", p);
      this.$message({
        message: "添加成功",
        type: "success",
        onClose: () => {
          this.$router.push({
            name: "petowners"
          });
        }
      });
    }
  }
};
</script>
